lodestar-types
![Node Version](https://img.shields.io/badge/node-12.x-green)
This package is part of ChainSafe's Lodestar project
Typescript and SSZ types for Eth2 datastructures
Usage
Using the typescript types
import {BeaconState} from "@chainsafe/lodestar-types";
const b: BeaconState = {
slot: 5,
...
};
Using the ssz types
import {types as mainnetTypes} from "@chainsafe/lodestar-types/lib/ssz/presets/mainnet";
import {types as minimalTypes} from "@chainsafe/lodestar-types/lib/ssz/presets/mainnet";
mainnetTypes.BeaconState.defaultValue();
minimalTypes.BeaconState.defaultValue();
...
import {createIBeaconSSZTypes} from "@chainsafe/lodestar-types";
import {IBeaconParams} from "@chainsafe/lodestar-params";
const testnetParams: IBeaconParams = {
...
};
const testnetTypes = createIBeaconSSZTypes(testnetParams);
testnetTypes.BeaconState.defaultValue();
License
Apache-2.0 ChainSafe Systems